<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="keywords" content="">
	<meta name="description" content="">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
	<title>正泰智慧电力运维系统</title>
	<link rel="stylesheet" href="/pages/layui/login/css/style.css"/>
	<link rel="stylesheet" href="/layui/css/layui.css"/>
	<!-- 提示升级高级浏览器操作 -->
	<style>
		.ie-content{  position: fixed; left: 0; top: 0; right: 0; bottom:0; background:#fff; z-index: 1000;}
		.ie-content-bj{ width: 1000px; height: 380px; position: fixed; left: 50%; top: 36%; margin:-190px 0 0 -500px;  }
		.ie-list{ padding:168px 0 0 371px; }
		.ie-list a{ margin-right: 80px; }

	</style>
</head>
<body class="body_bj">

<div class="login" style="height: 250px;">
	<div class="logo">
		正泰智慧电力运维系统
	</div>
	<form class="layui-form" action="">
		<div class="login-border">
			<ul class="login-list">
				<li><i class="zhanghao"></i><input type="text" name="username"  lay-verify="required|username"  placeholder="请输入用户名" autocomplete="off"></li>
				<li><i class="mima"></i><input type="password" name="password" lay-verify="required|password"  placeholder="请输入密码" autocomplete="off"></li>
			</ul>
		</div>
		<div><a class="btn" id="enterSubmit" lay-filter="userLogin" lay-submit="" style="cursor:pointer;">登录</a></div>
	</form>
</div>
<script type="text/javascript" src="/layui/layui.js"></script>
<script>
	layui.use(['jquery','form','layer'], function(){
		var $ = layui.jquery,form = layui.form,layer = layui.layer;

		//自定义验证规则
		form.verify({
			username: function(value){
				if(value==''){
					return '输入用户名';
				}
			},
			password: function(value){
				if(value==''){
					return '输入密码';
				}
			}
		});

		//监听提交
		form.on('submit(userLogin)', function(data){
			//layer.alert(JSON.stringify(data.field), {
			//  title: '最终的提交信息'
			//});
			var url='userLogin';
			$.ajax({
				type : "POST",
				url : url,
				data : {
					s_form_data : JSON.stringify(data.field)
				},
				dataType : "json",
				success : function(data) {
					if(data.status==false){
						layer.alert(data.msg, { title: '信息',icon: 5});
					}else{
						layer.msg('登录成功,请稍后...', {icon: 1});
						setTimeout("direct()",1000) ;


					}
				}
			});

			return false;
		});

		//回车键触发提交
		$("input").keydown(function(event) {
			if(event.keyCode == 13) {
				document.getElementById("enterSubmit").click();
			}

		});

	});

	function direct (){
		location.href="direct_home";
	}



</script>

</body>
</html>